{include file='pub/base' /}
  <form action="{:url('Node/sort')}" method="post" name="form">
  
	<script type="text/javascript" src="__LIB__/treetable/jquery.min.js"></script>
	<script type="text/javascript" src="__LIB__/treetable/jquery.treetable.js"></script>
	<link rel='stylesheet' type='text/css' href='__LIB__/treetable/css/jquery.treeTable.css' />
 <table id="tree" class="table table-border table-bordered table-hover table-bg ml-20 mt-20 mr-20" style="width:98%">
		<thead><tr>
        <td colspan="7">
          <span class="f-l"><h4>后台菜单(节点)管理</h4></span>
          <span class="f-r">
            <a class='btn btn-primary radius' onclick='layer_show("菜单添加","{:url("add")}","450","500")'>添加菜单(节点)</a>
          </span>
        </td></tr>
		</thead>
        <tr class="text-c">
          <th width="150">排序权重</th>
          <th width="30">ID</th>
          <th >菜单名称</th>
          <th width="70">类型</th>
          <th width="70">状态</th>
          <th width="70">显示</th>
          <th width="200">管理操作<a id='aaa'></a></th>
        </tr>
        {$html_tree|raw}
        <tr class="tr">
          <td colspan="7" valign="middle">
            <input class='btn btn-primary radius' type="submit" value="排序" class="bginput" />
          </td>
        </tr>
    </table>
  </form>
</body>
  </html>

<script>
/*管理员-删除*/
function admin_del(obj,id){
	layer.confirm('确认要删除吗？',function(index){
		$.ajax({
			type: 'POST',
			url: '{:url("del")}.?id='+id+'',
			dataType: 'json',
			success: function(data){
				if(data.code==0){
					$(obj).parents("tr").remove();
				}
				layer.msg(data.msg,{icon:1,time:1000});
			},
			error:function(data) {
				console.log(data.msg);
			},
		});		
	});
}

</script>
<script type="text/javascript">
  $(document).ready(function() {
  	//树配置
    $("#tree").treeTable({
		indent: 20, 
    	expandable: true,
    });
	 $("#node-1 a.expander").trigger('click'); 
   });
  
</script>